package cn.wxq.daily.empdailymgforserve.service.impl;

import cn.wxq.daily.empdailymgforserve.domain.AbilitySingle;
import cn.wxq.daily.empdailymgforserve.mapper.AbilitySingleDao;
import cn.wxq.daily.empdailymgforserve.service.AbilitySingleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 单选题业务
 */
@Service
public class AbilitySingleServiceImpl implements AbilitySingleService{
    @Autowired
    private AbilitySingleDao abilitySingleDao;

    /**
     * 完善试卷，向最新的试卷添加试题
     * @param abilitySingle
     * @return
     */
    @Override
    public int addQuestion(AbilitySingle abilitySingle) {
        return abilitySingleDao.addQuestion(abilitySingle);
    }

    /**
     * 获取这套试卷所关联的题目
     * @param alityPaperId
     * @return
     */
    @Override
    public List<AbilitySingle> papersingles(Integer alityPaperId) {
        return abilitySingleDao.papersingles(alityPaperId);
    }

    /**
     * 当single表中相关试题存入到题库中，删除single表中的试题
     * @param alityPaperId
     */
    @Override
    public int deletePaper(Integer alityPaperId) {
       return abilitySingleDao.deletePaper(alityPaperId);
    }

    /**
     * 统计一套试卷中有多少题目
     * @param alityPaperId
     * @return
     */
    @Override
    public int totalCount(Integer alityPaperId) {
        return abilitySingleDao.totalCount(alityPaperId);
    }
}
